import pytest
import requests
from selenium import webdriver
from selenium.webdriver.chrome.service import Service




@pytest.fixture(scope="session")
def driver():
    """全局driver fixture"""
    chrome_path = r'C:\Program Files\Google\Chrome\Application\chromedriver.exe'
    chrome_sevice = Service(executable_path=chrome_path)
    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument("--window-size=1920,1080")

    driver = webdriver.Chrome(service=chrome_sevice, options=chrome_options)
    driver.maximize_window()

    yield driver
    driver.quit()
